Skip to content

Declare knitr as a runtime dependency - #282

Open
dajiaohuang wants to merge 1 commit into
daattali:masterfrom
dajiaohuang:repostew/knitr-runtime-dependency-20261015
Open

dajiaohuang wants to merge 1 commit into
daattali:masterfrom
dajiaohuang:repostew/knitr-runtime-dependency-20261015

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Oct 15, 2026 •

Copy link
Copy Markdown

Problem

After installing the development version with only its required dependencies, the documented extendShinyjs() example fails while constructing the UI:

library(shiny)
library(shinyjs)
fluidPage(
  useShinyjs(),
  extendShinyjs(text = "shinyjs.pageCol = function(params) {}", functions = "pageCol")
)
# Error in loadNamespace(x): there is no package called 'knitr'

insertHead() unconditionally calls knitr::opts_knit$get("rmarkdown.runtime"), including in ordinary Shiny apps, but knitr is only in Suggests. inlineCSS() also uses this helper.

Change

Move the existing knitr dependency, keeping its minimum version, from Suggests to Imports so normal dependency installation includes the package already needed at runtime. No behavior or generated documentation changes.

Validation

  • R 4.3.3 / Shiny 1.8.0: installed shinyjs, derived its recursive required-dependency closure from installed package metadata, and restricted .libPaths() to that closure plus base packages. On master 59a0fae, the documented UI fails with missing knitr; with this change, the same closure includes knitr and the UI constructs successfully.
  • Source package install/load checks pass.
  • Existing test-hidden.R: 23 expectations pass.
  • Synthetic loopback Shiny app in Chrome: guide form, module namespaces, visibility/state/reset, and extension init/parameters/defaults exercised. A separate existing removeEvent issue is not addressed by this dependency-only change.
  • Full cross-platform R-CMD-check and shinytest2 suite not run locally.

Summary by CodeRabbit

  • Chores
    • Updated package configuration. No changes were made to public interfaces or user-facing functionality.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e4846e4f-cb45-4c68-868e-f01e7366ca00
📥 Commits

Reviewing files that changed from the base of the PR and between 59a0fae and a07f83b.

📒 Files selected for processing: 1
  • DESCRIPTION

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The DESCRIPTION file moves knitr (>= 1.7) from Suggests to Imports. Other listed dependencies remain unchanged.

Changes: knitr Dependency Declaration

Layer / File(s) Summary
Update knitr dependency declaration
DESCRIPTION
knitr (>= 1.7) moves from Suggests to Imports. Other listed dependencies remain in their sections.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a07f8

This change includes knitr in normal package installations for the described runtime helpers. No concrete merge blocker is identified; the PR appears mergeable subject to normal project checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: moving knitr into the runtime dependencies.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

I’m a rabbit, quick to hop,
Knitr moves into Imports’ stop.
Suggests has one less name to show,
The other packages stay in tow.
I nibble clover, then I go!

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant